package itheima.demo01;

import java.util.ArrayList;

public class StudentUnit {
    private StudentUnit() { //静态方法
    }

    public static int getMaxAgeStudent(ArrayList<Student> list) {
        //定义一个数字参照
        int max = list.get(0).age();
        for (int i = 0; i < list.size(); i++) {
            int temp = list.get(i).age();
            if (temp > max) {
                max = temp;
            }
        }
        return max;
    }
}
